#ifndef __SINGLETON_H__
#define __SINGLETON_H__

#include "stdafx.h"

namespace GeorgeLib
{

	template<class T>
	class DLLEXPORT Singleton
	{
		// -- How to use this class -- //
		//
		// class mySingleton : public Singleton<mySingleton>
		//	{
		//		// declare stuff
		//	};
	private:
		static T *instance;
	public:
		~Singleton()
		{
			DELETE_PTR(instance);
		}

		static T* getInstance(void)
		{
			if (!instance) instance = new T;
			return instance;
		}
	};

	template<class T>
	T* Singleton<T>::instance = NULL;

} // namespace GeorgeLib

#endif